home *** CD-ROM | disk | FTP | other *** search
- /*
- * $Header: externs.h,v 1.5 87/05/19 18:48:30 schoch Exp $
- */
-
- #include "constants.h"
- #include <stdio.h>
-
- #ifdef XKS
- #include <X/Xlib.h>
- #define NULL 0
- #define TOPSPACE (64+18)
- #define FALSE 0
- #define TRUE 1
- typedef unsigned char bool;
- #else
- #include <curses.h>
- #endif XKS
-
- #include <errno.h>
- #include <sys/types.h>
- /* on machines without alloca () */
- /* #define alloca malloc */
-
- struct IN
- {
- int i;
- struct IN *n;
- };
- typedef struct IN *LIST;
-
- struct MOVE
- {
- int from;
- int to;
- struct MOVE *n;
- };
- typedef struct MOVE *MOVELIST;
-
- extern u_char occupant [100]; /* what piece occupies square */
- extern u_char whose [100]; /* which color occupies square */
- extern LIST dirlist [7]; /* directions a piece moves */
- extern pawndir [2]; /* direction pawns of move */
- extern LIST piecelocs [2]; /* locations of pieces */
- extern int kingloc [2]; /* location of king */
- extern MOVELIST movelist; /* record of game */
- extern u_char ourcolor;
- extern u_char theircolor;
- extern char *colorname [];
- extern int lastmovefrom;
- extern int lastmoveto;
- extern u_char virgin [100]; /* pieces not moved or captured */
- extern bool drawok [2]; /* side has agreed to draw */
- extern bool resign; /* somebody resigned */
- extern bool dead; /* somebody died */
- extern bool reverse; /* Show board in reverse */
- extern u_char color; /* Who's turn it is */
- extern u_char state; /* What state we're in */
- extern u_char option [NOPTIONS]; /* options players must agree on*/
- extern bool iamserver; /* am I the server player? */
- extern FILE *inp, *out; /* socket for opponent */
- extern int errno; /* system error numbers */
-
- #ifdef XKS
- Window window;
- Window iconwindow;
- Font font;
- int move; /* piece being moved by mouse */
- Pixmap pieces_masks[8];
- Pixmap pieces_icons[8];
- extern u_char ghost[100]; /* opponent's "ghost" pieces */
- extern u_char captured[32]; /* pieces captured */
- #else
- extern char symbol [7]; /* symbols for printing pieces */
- extern WINDOW *blanksq [89]; /* blank chessboard squares */
- extern WINDOW *square [89]; /* contents of chessboard */
- extern WINDOW *win [23]; /* message window areas */
- extern WINDOW *backupwin [23]; /* for switching screens */
- extern WINDOW *backupscreen; /* used for redrawing vt220 */
- extern WINDOW *blankscreen; /* used for redrawing vt220 */
- extern char sqcolor [2]; /* character used for square */
- extern bool vtterm; /* is this a vt220? */
- extern bool dumbterm; /* are we dumb? */
- extern bool reversescr; /* can terminal inverse video? */
- extern int sqheight; /* height of a square */
- extern int sqwidth; /* width of a square */
- #endif
-